﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Fight.userControls;

namespace Fight
{
    public class general
    {
        public enum gameMode { singlePlayer, multiplayerSameComputer, multiplayerNetwork };
        public enum fighterSide { leftPlayer, rightPlayer };
        public enum fighterMode { standing, movingRight, movingLeft, jumpingRight, jumpingLeft, JumpKick, legKick, Punch};



        public static int leftMarginForLeftFighterOnGameStart = 40;
        public static int rightMarginForRightFighterOnGameStart = 10;
        public static int fighterHightPlusMarginFromGround = 170+20;

        public static int moveLeftAndRightAnimationDuration = 800;//millisecond
        public static int moveLeftAndRightAnimationDistance = 140;
        public static int moveUpAnimationDuration = 400;//millisecond
        public static int moveUpAnimationDistance = 140;


        #region initializeAbles
        public static double screenWidth = 1024;
        public static double screenHeight = 768;
        public static double fighterWidth = 0;
        public static double groundHeightTopDistance = 768;
        public static fighter leftFighter;
        public static fighter rightFighter;
        #endregion



        public static UserControl FindParrentUserControl(DependencyObject child, string type)
        {

            DependencyObject parent = VisualTreeHelper.GetParent(child);
            if (parent.GetType().ToString() == type)
                return (UserControl)parent;

            if (parent == null) return null;

            return FindParrentUserControl(parent, type);
        }
    }

    public static class firstPlayerMove
    {
        public static general.fighterSide side = general.fighterSide.rightPlayer;
        public const Key keyMoveRight = Key.Right;
        public const Key keyMoveLeft = Key.Left;
        public const Key keyJump = Key.Up;
        public const Key keyKick = Key.Space;
        public const Key keyPunch = Key.Alt;
    }

        public static class secondPlayerMove 
    {
        public static general.fighterSide side = general.fighterSide.leftPlayer;
        public const Key keyMoveRight = Key.D;
        public const Key keyMoveLeft = Key.A;
        public const Key keyJump = Key.W;
        public const Key keyKick = Key.G;
        public const Key keyPunch = Key.H;
          
    }
}
